#include "ball.h"
#include <QGraphicsItem>
#include <QPainter>

Ball::Ball(int diameter) :
    _diameter(diameter)
{
    setFlag(ItemIsMovable, true);
}

QRectF Ball::boundingRect() const
{
    return QRectF(QRect(0, 0, _diameter, _diameter));
}

void Ball::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->setBrush(Qt::green);
    painter->drawEllipse(0, 0, _diameter, _diameter);
}
